import json
import os


def save_conf(config_file,Setting):
    with open(config_file, 'w', encoding='utf-8') as f:
        json.dump(Setting, f, ensure_ascii=False, indent=4)


def read_conf(config_file):
    Settings=None
    if not os.path.exists(config_file):
        with open(config_file, 'w', encoding='utf-8') as f:
            json.dump(Settings, f, ensure_ascii=False, indent=4)
    else:
        with open(config_file, 'r', encoding='utf-8') as f:
            return json.load(f)
    return Settings


